package com.zhangxin.threadcoreknowledge.stopthread;

/**
 * run是能抛出checked Exception,只能try catch
 */
public class Demo05RunThrowException {

    // 在方法签名中抛出异常
    public void aVoid() throws Exception {
        throw new Exception();
    }


    public static void main(String[] args) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    new Demo05RunThrowException().aVoid();
                } catch (Exception e) {
                    // 捕获异常后的补救措施
                    e.printStackTrace();
                }
            }
        }).start();


    }

}
